﻿// // --------------------------------------------------------------------------------------------------------------------
// // <copyright  file="Class1.cs" company="AIT Gmbh & Co.KG" />
// // ----------------------------------------------------------------------------------------------------------------
namespace ConsoleApplication1
{
    #region

    using System;
    using System.Collections.Generic;

    #endregion

    /// <summary>
    ///     The class 1.
    /// </summary>
    public class Class1 : List<T>
    {
        private double Variable1;
        
        /// <summary>
        ///     The do something.
        /// </summary>
        protected internal void DoSomething()
        {
            int Variable1 = 2;

            var a = (int)2.4;
            double b = 3.7;

            Console.WriteLine(a + b);
            Console.ReadLine();

            bool? isValid; 
            // Zustand des Objektes
            // isValid = null | isValid.Value = null | isValid.HasValue = false

            // Zuweisung
            isValid = true;

            // Abfrage von Objektzustand | if(isValid) ist ungültig
            if(isValid.HasValue && isValid.Value)
            {            }

            Class1 element = new Class1();

            
        }
    }

    public class Rechteck
    {
        private double _a;
        private double _b;

        public Rechteck() 
            : this(10, 10)
        {
        }

        public Rechteck(double a)
            : this(a, a)
        {
        }

        public Rechteck(double a, double b)
        {
            _a = a;
            _b = b;
        }
    }

    public abstract class Verkehrsmittel
    {
        public abstract void Bewegen(double distanz);

        public virtual double GetTransportkosten()
        {
            return 0;
        }
    }

    public class Flugzeug : Verkehrsmittel
    {
        public double MaxSpeed { get; set; }

        private double _maximumSpeed;
        public double MaximumSpeed
        {
            get{return _maximumSpeed;}
            private set{ _maximumSpeed = value;}
        }

        public DateTime Yesterday
        {
            get
            {
                return DateTime.Now.Subtract(TimeSpan.FromDays(1));
            }
        }

        public override void Bewegen(double distanz)
        {
            // Fliege die distanz
        }

        public override double GetTransportkosten()
        {
            return 1000;
        }
    }

    public class Fahrrad : Verkehrsmittel
    {
        public override void Bewegen(double distanz)
        {
            // Tritt in die Pedale
        }
    }
}